import mountNativeElement from './mountNativeElement';
import mountComponent from './mountComponent';
import { isFunction } from './utils/index';

export default function mountElement(vDom, container, oldDom, insert = false) {
  // 判断 vDom 是组件还是 nativeElement
  if (isFunction(vDom)) { // 是一个组件
    mountComponent(vDom, container, oldDom);
  } else {
    mountNativeElement(vDom, container, oldDom, insert); // 是元素dom
  }
}